create  table jms_dm.dm_tab_taking_scan_miss_count_dt (
                                                      agent_code varchar(60) NULL COMMENT "代理区code",
                                                      network_code varchar(30) NULL COMMENT "网点编码",
                                                      customer_code varchar(30) NULL COMMENT "客户编码",
                                                      pistol_id varchar(30) NULL COMMENT "扫描设备",
                                                      scan_user_code varchar(30) NULL COMMENT "扫描用户编码",
                                                      network_name varchar(80) NULL COMMENT "网点名称",
                                                      customer_name varchar(80) NULL COMMENT "客户名称",
                                                      scan_user varchar(60) NULL COMMENT "扫描用户",
                                                      should_scan_cnt int(11) NULL COMMENT "应扫量",
                                                      taking_miss_cnt int(11) NULL COMMENT "揽收漏扫量",
                                                      send_miss_cnt int(11) NULL COMMENT "发件揽收漏扫量",
                                                      date_time date NULL COMMENT "查询日期",
                                                      agent_name varchar(60) NULL COMMENT "代理区name"
)
    DUPLICATE KEY(agent_code, network_code, customer_code, pistol_id, scan_user_code)
COMMENT "诊断用_揽收漏扫各种粒度汇总"
PARTITION BY RANGE(date_time)
(START("2023-11-01") END ("2023-11-25") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(network_code) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-186",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);